<template>
	<view class="content" :style="{heigt: QHeight + 'px'}">
		<!-- ...123456789 -->
		<!-- <u-image src="../../static/guide/guide.png"  mode="widthFix"></u-image> -->
		<image src="https://oss.arapp.net/img/guide.png" mode="" style="height: 100vh;"></image>
		<!-- <view class="jump" @click="jump">
			<u-circle-progress bg-color="transparent" active-color="#ddd" width="150" :percent="100" duration="3500">
				<view class="u-progress-content">
					<text class='u-progress-info'>跳过</text>
				</view>
			</u-circle-progress>
		</view> -->
	</view>
</template>

<script>
	export default {
		data() {
			return {
				time: 1,
				QHeight: 0,
				timer: null
				
			}
		},
		onLoad() {
			// 获取可用窗口的高度
			uni.getSystemInfo({
				success: (res) => {
					let h = res.windowHeight - uni.upx2px(0)
					this.QHeight = h
				}
			})
			// 启动时调用定时器
			let timeS = this.time
			this.QTime(timeS)
		},
		methods: {
			QTime(timeS) {
				this.timer = setInterval(() => {
					timeS--
					if (timeS == 0) {
						clearInterval(this.timer)
						const value = uni.getStorageSync('launchFlag')
						if (value) {
							// launchFlag=true直接跳转到首页
							console.log(value)
							uni.switchTab({
								url: '/pages/index/index2'
							})
							clearInterval(this.timer)
						} else {
							console.log(value)
							uni.navigateTo({
								url: '/pages/index/guidePage'
							})
							clearInterval(this.timer)
						}
					}
					console.log(timeS)
				}, 1000)
			},
			jump() {
				this.time = 1
				clearInterval(this.timer)
				this.QTime(this.time)
			}
		}
	}
</script>

<style lang="scss" scoped>
	.content {
		width: 100%;
		height: 100%;
		image {
			width: 100%;
		}
		.jump {
			position: fixed;
			top: 40px;
			right: 20px;
		}
		.u-progress-content {
			display: flex;
			align-items: center;
			justify-content: center;
		}
		
		.u-progress-dot {
			width: 16rpx;
			height: 16rpx;
			border-radius: 50%;
			background-color: #fb9126;
		}
		
		.u-progress-info {
			font-size: 28rpx;
			padding-left: 16rpx;
			letter-spacing: 2rpx
		}
	}
	
</style>
